package lws.com.liwushuo.bean.shouye;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import java.util.List;

import lws.com.liwushuo.view.fragment.shouye.JinxuanViepagerActivity;

/**
 * Created by ZQ on 2016/10/13.
 */
public class JinxuanLunboBean {
    /**
     * code : 200
     * data : {"banners":[{"ad_monitors":[],"channel":"all","id":740,"image_url":"http://img03.liwushuo.com/image/161014/cz066durh.jpg-w720","order":200,"status":0,"target":{"banner_image_url":"http://img02.liwushuo.com/image/161014/gbcva42ex.jpg-w300","banner_webp_url":"http://img02.liwushuo.com/image/161014/gbcva42ex.jpg?imageView2/2/w/300/q/85/format/webp","cover_image_url":"http://img03.liwushuo.com/image/161014/bvixdyy09.jpg-w720","cover_webp_url":"http://img03.liwushuo.com/image/161014/bvixdyy09.jpg?imageView2/2/w/720/q/85/format/webp","created_at":1476431266,"id":361,"posts_count":11,"status":1,"subtitle":"拯救直男审美！撩妹就靠Ta了","title":"直男穿搭术","updated_at":1476431660},"target_id":361,"target_type":"url","target_url":"liwushuo:///page?page_action=navigation&login=false&type=topic&topic_id=361","type":"collection","webp_url":"http://img03.liwushuo.com/image/161014/cz066durh.jpg?imageView2/2/w/720/q/85/format/webp"}]}
     * message : OK
     */

    private int code;
    private DataBean data;
    private String message;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static class DataBean {
        /**
         * ad_monitors : []
         * channel : all
         * id : 740
         * image_url : http://img03.liwushuo.com/image/161014/cz066durh.jpg-w720
         * order : 200
         * status : 0
         * target : {"banner_image_url":"http://img02.liwushuo.com/image/161014/gbcva42ex.jpg-w300","banner_webp_url":"http://img02.liwushuo.com/image/161014/gbcva42ex.jpg?imageView2/2/w/300/q/85/format/webp","cover_image_url":"http://img03.liwushuo.com/image/161014/bvixdyy09.jpg-w720","cover_webp_url":"http://img03.liwushuo.com/image/161014/bvixdyy09.jpg?imageView2/2/w/720/q/85/format/webp","created_at":1476431266,"id":361,"posts_count":11,"status":1,"subtitle":"拯救直男审美！撩妹就靠Ta了","title":"直男穿搭术","updated_at":1476431660}
         * target_id : 361
         * target_type : url
         * target_url : liwushuo:///page?page_action=navigation&login=false&type=topic&topic_id=361
         * type : collection
         * webp_url : http://img03.liwushuo.com/image/161014/cz066durh.jpg?imageView2/2/w/720/q/85/format/webp
         */

        private List<BannersBean> banners;

        public List<BannersBean> getBanners() {
            return banners;
        }

        public void setBanners(List<BannersBean> banners) {
            this.banners = banners;
        }

        public static class BannersBean implements View.OnClickListener {
            private String channel;
            private int id;
            private String image_url;
            private int order;
            private int status;
            /**
             * banner_image_url : http://img02.liwushuo.com/image/161014/gbcva42ex.jpg-w300
             * banner_webp_url : http://img02.liwushuo.com/image/161014/gbcva42ex.jpg?imageView2/2/w/300/q/85/format/webp
             * cover_image_url : http://img03.liwushuo.com/image/161014/bvixdyy09.jpg-w720
             * cover_webp_url : http://img03.liwushuo.com/image/161014/bvixdyy09.jpg?imageView2/2/w/720/q/85/format/webp
             * created_at : 1476431266
             * id : 361
             * posts_count : 11
             * status : 1
             * subtitle : 拯救直男审美！撩妹就靠Ta了
             * title : 直男穿搭术
             * updated_at : 1476431660
             */

            private TargetBean target;
            private int target_id;
            private String target_type;
            private String target_url;
            private String type;
            private String webp_url;
            private List<?> ad_monitors;

            public String getChannel() {
                return channel;
            }

            public void setChannel(String channel) {
                this.channel = channel;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getImage_url() {
                return image_url;
            }

            public void setImage_url(String image_url) {
                this.image_url = image_url;
            }

            public int getOrder() {
                return order;
            }

            public void setOrder(int order) {
                this.order = order;
            }

            public int getStatus() {
                return status;
            }

            public void setStatus(int status) {
                this.status = status;
            }

            public TargetBean getTarget() {
                return target;
            }

            public void setTarget(TargetBean target) {
                this.target = target;
            }

            public int getTarget_id() {
                return target_id;
            }

            public void setTarget_id(int target_id) {
                this.target_id = target_id;
            }

            public String getTarget_type() {
                return target_type;
            }

            public void setTarget_type(String target_type) {
                this.target_type = target_type;
            }

            public String getTarget_url() {
                return target_url;
            }

            public void setTarget_url(String target_url) {
                this.target_url = target_url;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getWebp_url() {
                return webp_url;
            }

            public void setWebp_url(String webp_url) {
                this.webp_url = webp_url;
            }

            public List<?> getAd_monitors() {
                return ad_monitors;
            }

            public void setAd_monitors(List<?> ad_monitors) {
                this.ad_monitors = ad_monitors;
            }

            /**
             * 轮播的跳转
             *
             * @param v
             */
            @Override
            public void onClick(View v) {
                if (type.equals("collection")) {//类型为集合 跳转，因为url类型 不会解析=-=
                    Context context = v.getContext();
                    Intent intent = new Intent(context, JinxuanViepagerActivity.class);
                    intent.putExtra("collectionId", target_id);
                    context.startActivity(intent);
                }

            }

            public static class TargetBean {
                private String banner_image_url;
                private String banner_webp_url;
                private String cover_image_url;
                private String cover_webp_url;
                private int created_at;
                private int id;
                private int posts_count;
                private int status;
                private String subtitle;
                private String title;
                private int updated_at;

                public String getBanner_image_url() {
                    return banner_image_url;
                }

                public void setBanner_image_url(String banner_image_url) {
                    this.banner_image_url = banner_image_url;
                }

                public String getBanner_webp_url() {
                    return banner_webp_url;
                }

                public void setBanner_webp_url(String banner_webp_url) {
                    this.banner_webp_url = banner_webp_url;
                }

                public String getCover_image_url() {
                    return cover_image_url;
                }

                public void setCover_image_url(String cover_image_url) {
                    this.cover_image_url = cover_image_url;
                }

                public String getCover_webp_url() {
                    return cover_webp_url;
                }

                public void setCover_webp_url(String cover_webp_url) {
                    this.cover_webp_url = cover_webp_url;
                }

                public int getCreated_at() {
                    return created_at;
                }

                public void setCreated_at(int created_at) {
                    this.created_at = created_at;
                }

                public int getId() {
                    return id;
                }

                public void setId(int id) {
                    this.id = id;
                }

                public int getPosts_count() {
                    return posts_count;
                }

                public void setPosts_count(int posts_count) {
                    this.posts_count = posts_count;
                }

                public int getStatus() {
                    return status;
                }

                public void setStatus(int status) {
                    this.status = status;
                }

                public String getSubtitle() {
                    return subtitle;
                }

                public void setSubtitle(String subtitle) {
                    this.subtitle = subtitle;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }

                public int getUpdated_at() {
                    return updated_at;
                }

                public void setUpdated_at(int updated_at) {
                    this.updated_at = updated_at;
                }


            }
        }
    }


//    /**
//     * code : 200
//     * data : {"banners":[{"ad_monitors":[],"channel":"all","id":726,"image_url":"http://img03.liwushuo.com/image/160923/iwedeg4nk.jpg-w720","order":700,"status":0,"target_id":1045899,"target_type":"url","target_url":"liwushuo:///page?page_action=navigation&login=false&type=post&post_id=1045899","type":"post","webp_url":"http://img03.liwushuo.com/image/160923/iwedeg4nk.jpg?imageView2/2/w/720/q/85/format/webp"},{"ad_monitors":[],"channel":"all","id":730,"image_url":"http://img01.liwushuo.com/image/160929/68bib1c1a.jpg-w720","order":600,"status":0,"target_id":null,"target_url":"liwushuo:///page?type=dailylucky","type":"url","webp_url":"http://img01.liwushuo.com/image/160929/68bib1c1a.jpg?imageView2/2/w/720/q/85/format/webp"},{"ad_monitors":[],"channel":"all","id":733,"image_url":"http://img01.liwushuo.com/image/161001/bvftzkor6.jpg-w720","order":300,"status":0,"target":{"banner_image_url":"http://img03.liwushuo.com/image/161001/d50iog9eh.jpg-w300","banner_webp_url":"http://img03.liwushuo.com/image/161001/d50iog9eh.jpg?imageView2/2/w/300/q/85/format/webp","cover_image_url":"http://img01.liwushuo.com/image/161001/vn25u2xq9.jpg-w720","cover_webp_url":"http://img01.liwushuo.com/image/161001/vn25u2xq9.jpg?imageView2/2/w/720/q/85/format/webp","created_at":1475327399,"id":358,"posts_count":7,"status":1,"subtitle":"这个秋季有Ta，让爱恒温相伴","title":"初秋保温杯来袭","updated_at":1475327565},"target_id":358,"target_type":"url","target_url":"liwushuo:///page?page_action=navigation&login=false&type=topic&topic_id=358","type":"collection","webp_url":"http://img01.liwushuo.com/image/161001/bvftzkor6.jpg?imageView2/2/w/720/q/85/format/webp"},{"ad_monitors":[],"channel":"all","id":732,"image_url":"http://img01.liwushuo.com/image/161001/5bk3k6eo5.jpg-w720","order":0,"status":0,"target":{"banner_image_url":"http://img01.liwushuo.com/image/161001/jut2ofrw1.jpg-w300","banner_webp_url":"http://img01.liwushuo.com/image/161001/jut2ofrw1.jpg?imageView2/2/w/300/q/85/format/webp","cover_image_url":"http://img02.liwushuo.com/image/161001/py6yuemqe.jpg-w720","cover_webp_url":"http://img02.liwushuo.com/image/161001/py6yuemqe.jpg?imageView2/2/w/720/q/85/format/webp","created_at":1475327041,"id":357,"posts_count":7,"status":1,"subtitle":"初秋乱穿衣指南，回头率up，up！","title":"初秋换新装","updated_at":1475327214},"target_id":357,"target_type":"url","target_url":"liwushuo:///page?page_action=navigation&login=false&type=topic&topic_id=357","type":"collection","webp_url":"http://img01.liwushuo.com/image/161001/5bk3k6eo5.jpg?imageView2/2/w/720/q/85/format/webp"}]}
//     * message : OK
//     */
//    @SerializedName("code")
//    private int code;
//    @SerializedName("data")
//    private DataBean data;
//    @SerializedName("message")
//    private String message;
//
//    public int getCode() {
//        return code;
//    }
//
//    public void setCode(int code) {
//        this.code = code;
//    }
//
//    public DataBean getData() {
//        return data;
//    }
//
//    public void setData(DataBean data) {
//        this.data = data;
//    }
//
//    public String getMessage() {
//        return message;
//    }
//
//    public void setMessage(String message) {
//        this.message = message;
//    }
//
//    public static class DataBean {
//        /**
//         * ad_monitors : []
//         * channel : all
//         * id : 726
//         * image_url : http://img03.liwushuo.com/image/160923/iwedeg4nk.jpg-w720
//         * order : 700
//         * status : 0
//         * target_id : 1045899
//         * target_type : url
//         * target_url : liwushuo:///page?page_action=navigation&login=false&type=post&post_id=1045899
//         * type : post
//         * webp_url : http://img03.liwushuo.com/image/160923/iwedeg4nk.jpg?imageView2/2/w/720/q/85/format/webp
//         */
//        @SerializedName("banners")
//        private List<BannersBean> banners;
//
//        public List<BannersBean> getBanners() {
//            return banners;
//        }
//
//        public void setBanners(List<BannersBean> banners) {
//            this.banners = banners;
//        }
//
//        public static class BannersBean implements View.OnClickListener {
//            @SerializedName("channel")
//            private String channel;
//            @SerializedName("id")
//            private int id;
//            @SerializedName("image_url")
//            private String image_url;
//            @SerializedName("order")
//            private int order;
//            @SerializedName("status")
//            private int status;
//            @SerializedName("target_id")
//            private int target_id;
//            @SerializedName("target_type")
//            private String target_type;
//            @SerializedName("target_url")
//            private String target_url;
//            @SerializedName("type")
//            private String type;
//            @SerializedName("webp_url")
//            private String webp_url;
//            @SerializedName("ad_monitors")
//            private List<?> ad_monitors;
//
//            public String getChannel() {
//                return channel;
//            }
//
//            public void setChannel(String channel) {
//                this.channel = channel;
//            }
//
//            public int getId() {
//                return id;
//            }
//
//            public void setId(int id) {
//                this.id = id;
//            }
//
//            public String getImage_url() {
//                return image_url;
//            }
//
//            public void setImage_url(String image_url) {
//                this.image_url = image_url;
//            }
//
//            public int getOrder() {
//                return order;
//            }
//
//            public void setOrder(int order) {
//                this.order = order;
//            }
//
//            public int getStatus() {
//                return status;
//            }
//
//            public void setStatus(int status) {
//                this.status = status;
//            }
//
//            public int getTarget_id() {
//                return target_id;
//            }
//
//            public void setTarget_id(int target_id) {
//                this.target_id = target_id;
//            }
//
//            public String getTarget_type() {
//                return target_type;
//            }
//
//            public void setTarget_type(String target_type) {
//                this.target_type = target_type;
//            }
//
//            public String getTarget_url() {
//                return target_url;
//            }
//
//            public void setTarget_url(String target_url) {
//                this.target_url = target_url;
//            }
//
//            public String getType() {
//                return type;
//            }
//
//            public void setType(String type) {
//                this.type = type;
//            }
//
//            public String getWebp_url() {
//                return webp_url;
//            }
//
//            public void setWebp_url(String webp_url) {
//                this.webp_url = webp_url;
//            }
//
//            public List<?> getAd_monitors() {
//                return ad_monitors;
//            }
//
//            public void setAd_monitors(List<?> ad_monitors) {
//                this.ad_monitors = ad_monitors;
//            }
//
//            @Override
//            public String toString() {
//                return "BannersBean{" +
//                        "channel='" + channel + '\'' +
//                        ", id=" + id +
//                        ", image_url='" + image_url + '\'' +
//                        ", order=" + order +
//                        ", status=" + status +
//                        ", target_id=" + target_id +
//                        ", target_type='" + target_type + '\'' +
//                        ", target_url='" + target_url + '\'' +
//                        ", type='" + type + '\'' +
//                        ", webp_url='" + webp_url + '\'' +
//                        ", ad_monitors=" + ad_monitors +
//                        '}';
//            }
//
//            /**
//             * 轮播的二级跳转
//             * @param v
//             */
//            @Override
//            public void onClick(View v) {
//                Context context = v.getContext();
//                Intent intent = new Intent(context, GonglueActivity.class);
//                intent.putExtra("collectionId",id);
//            }
//        }
//    }
}
